package com.cj.mainmodule

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 *created by chen jun
 *on 2021/5/26 14:45
 */
class ViewPagerAdapter(fragmentActivity: FragmentActivity,private val fragmentList:MutableList<Fragment>):FragmentStateAdapter(fragmentActivity) {
    override fun getItemCount(): Int {
        return fragmentList.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragmentList[position]
    }
}